import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm'
import { Staff } from 'src/modules/staff/entities/staff.entity'
import { App } from 'src/app.entity'
import { Department } from 'src/modules/department/entities/department.entity'
import { Job } from 'src/modules/job/entities/job.entity'
@Entity()
export class Transfer extends App {
  @ManyToOne(() => Staff)
  @JoinColumn({ name: 'staff_id' })
  staff: Staff
  @ManyToOne(() => Department)
  @JoinColumn({ name: 'before_department' })
  beforeDepartment: Department
  @ManyToOne(() => Department)
  @JoinColumn({ name: 'after_department' })
  afterDepartment: Department
  @ManyToOne(() => Job)
  @JoinColumn({ name: 'before_job' })
  beforeJob: Job
  @ManyToOne(() => Job)
  @JoinColumn({ name: 'after_job' })
  afterJob: Job
  @Column({ type: 'varchar', length: 100, nullable: true })
  reason: string
  @Column({ type: 'varchar', length: 10 })
  date: string
  @Column({ type: 'varchar', length: 200, nullable: true })
  remark: string
}
